package com.glsc.ngateway.common.base.domain.mysql.opmanage.report.regulatory;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Objects;

@Data
@Entity
@Table(name = "t_reg_rpt_nafmii_protocol")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
@ExcelIgnoreUnannotated
@IdClass(RegRptNAFMIIProtocol.PK.class)
public class RegRptNAFMIIProtocol {
    public static class PK implements Serializable {
        private BigInteger mainId;
        private BigInteger id;

        public BigInteger getMainId() {
            return mainId;
        }

        public void setMainId(BigInteger mainId) {
            this.mainId = mainId;
        }

        public BigInteger getId() {
            return id;
        }

        public void setId(BigInteger id) {
            this.id = id;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) {
                return true;
            }
            if (o == null || getClass() != o.getClass()) {
                return false;
            }
            PK pk = (PK) o;
            return Objects.equals(mainId, pk.mainId) && Objects.equals(id, pk.id);
        }

        @Override
        public int hashCode() {
            return Objects.hash(mainId, id);
        }
    }

    @Id
    @Column(name = "id")
    private BigInteger id;

    @Id
    @Column(name = "main_id")
    private BigInteger mainId;

    @ExcelProperty(index = 0)
    @Column(name = "fc_protocol_type")
    private String protocolType;

    @ExcelProperty("上月末本年累计")
    @Column(name = "ff_amount_till_lastmonth")
    private Double amountTillLastmonth;

    @ExcelProperty("本月新增")
    @Column(name = "ff_increased_this_month")
    private Double increasedThieMonth;

    @ExcelProperty("本年累计")
    @Column(name = "ff_amount")
    private Double amount;

    @ExcelProperty("本月末有效")
    @Column(name = "ff_valid_amount")
    private Double validAmount;

    public void setId(BigInteger id) {
        this.id = id;
    }

    public BigInteger getId() {
        return id;
    }

    public BigInteger getMainId() {
        return mainId;
    }

    public void setMainId(BigInteger mainId) {
        this.mainId = mainId;
    }

    public void setProtocolType(String protocolType) {
        this.protocolType = protocolType;
    }

    public String getProtocolType() {
        return protocolType;
    }

    public Double getAmountTillLastmonth() {
        return amountTillLastmonth;
    }

    public void setAmountTillLastmonth(Double amountTillLastmonth) {
        this.amountTillLastmonth = amountTillLastmonth;
    }

    public Double getIncreasedThieMonth() {
        return increasedThieMonth;
    }

    public void setIncreasedThieMonth(Double increasedThieMonth) {
        this.increasedThieMonth = increasedThieMonth;
    }

    public Double getAmount() {
        return amount;
    }

    public Double getValidAmount() {
        return validAmount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public void setValidAmount(Double validAmount) {
        this.validAmount = validAmount;
    }
}
